# 挂载nfs
apt update
apt install -y nfs-common

# 挂载
mkdir -p /data/shared
mount -t nfs 192.168.24.243:/data/shared /data/shared

# 查看挂载
showmount -e 192.168.24.243

# k8s

# 关闭swap
sudo swapoff -a
# 关闭防火墙
sudo ufw disable
# 安装docker
apt install -y docker.io bridge-utils
# 启动docker
systemctl start docker
# docker自启动
systemctl enable docker
# 修改内核参数
apt install -y bridge-utils
modprobe br_netfilter
lsmod | grep br_netfilter
# 安装工具
apt install -y ca-certificates curl software-properties-common apt-transport-https curl
# 拉取镜像源
curl -s https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | sudo apt-key add -
# 添加镜像源
echo "deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main" >> /etc/apt/sources.list.d/kubernetes.list
# 更新
apt update
# 安装k8s
apt install -y kubelet=1.23.1-00 kubeadm=1.23.1-00 kubectl=1.23.1-00
# 阻止k8s自动更新
apt-mark hold kubelet kubeadm kubectl
# 加入集群
# kubeadm join 192.168.24.244:6443 --token abcdef.0123456789abcdef \
#        --discovery-token-ca-cert-hash sha256:c4be4581d222082deae5e1d7af6b62335c45107ee27932d66999072f66a733f2